@extends('base')
@section('style')
    <style>
        .pos_re {
            position: relative;
            z-index: 2;
        }
        .productGroup>li>ul>li>a{ font-size: 12px !important; }
    </style>
@stop
@section('content')
    <ul class="footprint">
        <li><a href="javascript:void(0);">{{trans('base.HOME')}}</a></li>
        <li><a href="javascript:void(0);">&gt;&gt;</a></li>
        <li><a href="javascript:void(0);">{{trans('base.EVENTS')}}</a></li>
        <li><a href="javascript:void(0);">&gt;&gt;</a></li>
        <li><a href="javascript:void(0);">{{ $currentYear }}</a></li>
        @if($id>0)
        <li><a href="javascript:void(0);">&gt;&gt;</a></li>
        <li><a href="javascript:void(0);">{{ $model->name }}</a></li>
        @endif
    </ul>
    <div class="contant mttop">
        <div class="fl pos_re">
        @if('zh_cn' == Cookie::get('lang'))
            <h2 class="title yin_font2" style="text-align: left;text-indent: 2.6em;">
            {{trans('base.EVENTS')}}</h2>
            @else
            <h2 class="title yin_font2" style=" padding-right:60px;">
            {{trans('base.EVENTS')}}</h2>
            @endif
            <div class="left_nav">
                <ul class="productGroup">
                    @foreach($events as $key=>$event)
                        <li>
                            <a href="javascript:;" class="type_show">{{$event['name']}}</a>
                            @if([] != $event['data'])
                                <ul class="product_nav ml0 product_nav" style="display: none;">
                                    @foreach($event['data'] as $key => $data)
                                        <li><a href="{{url('/events/'.$key)}}">{{$data}}</a></li>
                                    @endforeach
                                </ul>
                            @endif
                        </li>
                    @endforeach
                    {{--<li><a href="#">2012</a>
                    </li>--}}
                </ul>
            </div>
        </div>
        <div class="contact_right">
            @if(0<$id)
                <div class="event_1">
                    <h2 class="eve_tit"><span>{{$model->name}}</span>
                        <b class="eve_time">{{trans('base.UploadTime')}}:{{$model->created_at}}</b>
                    </h2>
                    <article>
                        {!! json_decode($model->content)->content !!}
                    </article>
                </div>
            @else
                <ul class="eventlist">
                    @foreach($list as $key=>$item)
                        <li><a href="{{url('/events/'.$key)}}">{{$item}}</a></li>
                    @endforeach
                </ul>
            @endif
        </div>
    </div>
@stop
@section('js')
    <script>
        $(function () {
            $('.pro_nav_ative').parent().parent().show();
            $('.productGroup .type_show').on('click', function () {
                console.log(11);
                $(this).next().slideToggle(200);
                $(this).parent().siblings().find('li ul').slideUp(200);
                $(this).toggleClass('arrowdown');
            })
        })
    </script>
@stop